package com.winhxd.b2c.common.domain.order.vo;

import com.winhxd.b2c.common.domain.order.enums.OrderStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author zhangshuguang
 * @version 1.0
 * @date 2019/1/8、16:29
 * @Description 用户订单商品详情
 */
public class OrderListForCustomerVO {
    @ApiModelProperty(value = "订单商品详情", required = true)
    private List<OrderListItemForCustomerVO> orderItemVoList;
    @ApiModelProperty(value = "订单编号", required = true)
    private String orderNo;
    @ApiModelProperty(value = "订单状态 1 待付款 2 已取消 3待发货 4待收货5已完成 6已关闭", required = true)
    private Integer status;
    @ApiModelProperty(value = "订单状态描述", required = true)
    private String statusDesc;
    @ApiModelProperty(value = "订单总金额", required = true)
    private BigDecimal totalMoney;
    @ApiModelProperty(value = "订单实付金额", required = true)
    private BigDecimal otherTotal;
    @ApiModelProperty(value = "订单创建时间", required = true)
    private Date created;

    public List<OrderListItemForCustomerVO> getOrderItemVoList() {
        return orderItemVoList;
    }

    public void setOrderItemVoList(List<OrderListItemForCustomerVO> orderItemVoList) {
        this.orderItemVoList = orderItemVoList;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getStatusDesc() {
        if(null != this.status){
            if(this.status.equals(OrderStatusEnum.WAIT_PAY.getStatusCode())){
                statusDesc = OrderStatusEnum.WAIT_PAY.getStatusDes();
            }
            if(this.status.equals(OrderStatusEnum.CANCELED.getStatusCode())){
                statusDesc = OrderStatusEnum.CANCELED.getStatusDes();
            }
            if(this.status.equals(OrderStatusEnum.WAIT_DELIVERING.getStatusCode())){
                statusDesc = OrderStatusEnum.WAIT_DELIVERING.getStatusDes();
            }
            if(this.status.equals(OrderStatusEnum.WAIT_RECEIVING.getStatusCode())){
                statusDesc = OrderStatusEnum.WAIT_RECEIVING.getStatusDes();
            }
            if(this.status.equals(OrderStatusEnum.RECEIVIED.getStatusCode())){
                statusDesc = OrderStatusEnum.RECEIVIED.getStatusDes();
            }
            if(this.status.equals(OrderStatusEnum.FINISHED.getStatusCode())){
                statusDesc = OrderStatusEnum.FINISHED.getStatusDes();
            }

        }
        return statusDesc;
    }

    public void setStatusDesc(String statusDesc) {
        this.statusDesc = statusDesc;
    }

    public BigDecimal getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(BigDecimal totalMoney) {
        this.totalMoney = totalMoney;
    }

    public BigDecimal getOtherTotal() {
        return otherTotal;
    }

    public void setOtherTotal(BigDecimal otherTotal) {
        this.otherTotal = otherTotal;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }
}
